<?php if(count($data) > 0):?>
	<table class="table table-bordered table-striped">
		<tr>
			<?php foreach (reset($data) as $key => $value):?>
				<th><?php echo $key;?></th>
			<?php endforeach;?>
		</tr>
		<?php foreach ($data as $row):?>
		<tr>
			<?php foreach ($row as $val):?>
				<td><?php echo $val;?></td>
			<?php endforeach;?>
		</tr>
		<?php endforeach;?>
	</table>
<?php else:?>
	<div class="alert">
		Нет ни одной записи
	</div>
<?php endif;?>
